/*
 * @Description:
 * @Version: 1.0
 * @Autor: laikt
 * @Date: 2021-01-07 10:59:39
 * @LastEditors: laikt
 * @LastEditTime: 2021-01-07 10:59:48
 */
const debounce = {
    inserted: function(el, binding) {
        let timer
        el.addEventListener('click', () => {
            if (timer) {
                clearTimeout(timer)
            }
            timer = setTimeout(() => {
                binding.value()
            }, 1000)
        })
    }
}

export default debounce
